import { createSlice, PayloadAction } from '@reduxjs/toolkit';

interface UserTranslationState {
    hasTranslationPackage: boolean;
}

const initialState: UserTranslationState = {
    hasTranslationPackage: false, // 默认没有购买翻译包
};

const userTranslationSlice = createSlice({
    name: 'userTranslationstatus',
    initialState,
    reducers: {
        updateTranslationPackage(state, action: PayloadAction<boolean>) {
            state.hasTranslationPackage = action.payload;
        },
    },
});

export const { updateTranslationPackage } = userTranslationSlice.actions;
export default userTranslationSlice.reducer;
